package com.doubao.chat.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 聊天消息实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("chat_message")
public class ChatMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 唯一标识
     */
    private String uuid;

    /**
     * 会话ID
     */
    private Long sessionId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 智能体ID
     */
    private Long deviceId;

    /**
     * 角色 user/assistant/system
     */
    private String role;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 输入tokens
     */
    private Integer promptTokens;

    /**
     * 输出tokens
     */
    private Integer completionTokens;

    /**
     * AI提供商ID
     */
    private Long aiProviderId;

    /**
     * AI模型ID
     */
    private String aiModelId;

    /**
     * 存储类型 db/minio
     */
    private String storageType;

    /**
     * 存储路径
     */
    private String storagePath;

    /**
     * 消息hash
     */
    private String messageHash;

    /**
     * 客户端消息ID
     */
    private String clientMsgId;

    /**
     * 扩展信息JSON
     */
    private String extJson;

    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    private LocalDateTime updatedAt;
}